package com.example.demo.exception;

public class CommonException extends RuntimeException {
    private static final long serialVersionUID = 3655050728585279326L;
    private int code;

    public CommonException() {
        this.code = ErrorCode.ERROR.getCode();
    }

    public CommonException(String msg) {
        super(msg);
        this.code = ErrorCode.ERROR.getCode();
    }

    public CommonException(int code, String msg) {
        super(msg);
        this.code = ErrorCode.ERROR.getCode();
        this.code = code;
    }

    public CommonException(int code, String msg, Throwable cause) {
        super(msg, cause);
        this.code = ErrorCode.ERROR.getCode();
        this.code = code;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
